home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / CRS / crs53.d81 / 28may87s.pma / CXEQU.LIB < prev    next >
Text File  |  1979-12-31  |  17KB  |  651 lines

  1.  
  2.  
  3.  
  4. $*MACRO
  5.  
  6. false        equ    0
  7. true        equ    not false
  8.  
  9. use$fast    equ    false
  10. use$6551    equ    false    ;true
  11.  
  12. use$vt100    equ    false
  13. use$1581    equ    true
  14. banked        equ    true
  15. EXTSYS        equ    false    ; use external system as disk and char I/O
  16. pre$release    equ    false
  17.  
  18. ; start at Jan 1,1978     78  79  80  81  82  83  84  85  86
  19. dt$hx$yr    equ    365+365+366+365+365+365+366+365+365
  20. ;    1985              1  2  3  4  5  6  7  8  9 10 11 12
  21. date$hex    equ    dt$hx$yr+31+28+31+30+28
  22.  
  23. date    macro
  24.     db    '28 May 87'
  25.     endm
  26. ;
  27. ;    this is only for Pre-Released versions (done in RED)
  28. ;
  29. warning    macro
  30.     if    pre$release
  31.      db    cr,lf,lf
  32.      db    esc,esc,esc,red+20h
  33.      db    'User Beware:',cr,lf
  34.         ;1234567890123456789012345678901234567890
  35.      db    '       This version of the software is a',cr,lf
  36.      db    '  PRE-RELEASE  for testing only.  It has',cr,lf
  37.      db    '  been tested but has not yet passed QA.',cr,lf
  38.      db    esc,esc,esc,purple+50h
  39.      endif
  40.     endm
  41.  
  42.  
  43. space    macro    ?x,for
  44. ?x    equ    start
  45. start    set    start+for
  46.     endm
  47.  
  48. ;
  49. ; boot memory map (bank 0 only)
  50. ;
  51. bios02        equ    3000h    ;
  52. block$buffer    equ    3400h    ; uses 2K
  53. boot$parm    equ    3C00h    ; uses about 256 bytesè;
  54. ; bank 0 low memory map
  55. ;
  56. ROM        equ    0000h
  57. VIC$color    equ    1000h    ; I/O page only (IO$0 selected)
  58. SYS$key$area    equ    1000h    ; 3 256 byte blocks (allow 4)
  59. screen$40    equ    1400h    ; 2 X 80 X 25 = 4000 
  60. BANK$parm$blk    equ    2400h    ; allow 0.5K of parameters
  61. BIOS8502    equ    2600h    ; 1.5K
  62. VIC$screen    equ    2C00h    ; 1K
  63. ccp$buffer    equ    3000h    ; 0c80h (allow 4K)
  64. bank0$free    equ    4000h    ; start of free area in bank 0
  65. ;
  66. ; mapped I/O locations
  67. ;
  68. VIC        equ    0D000h        ; 8564
  69. SID        equ    0D400h        ; 6581
  70. MMU        equ    0D500h        ; 8722
  71. DS8563        equ    0D600h        ; 8563
  72. INT$6551    equ    0D700h        ; 6551 (added to enginnerring units)
  73. VIC$C$H        equ    0D800h        ; (memory mapped only in IO$0)
  74. VIC$C$L        equ    01000h        ; (memory and i/o mapped in IO$0)
  75. CIA1        equ    0DC00h        ; 6526
  76. CIA2        equ    0DD00h        ; 6526
  77. USART        equ    0DE00h        ; 6551 (extrn card)
  78. RAM$dsk$base    equ    0DF00h        ; 8726
  79.  
  80. ;
  81. ; Common memory allocation
  82. ;
  83. int$block    equ    0FC00h    ; mode 2 interrupt pointers (to FDFDh) 
  84. parm$block    equ    0FD00h    ; system parameters
  85. @buffer        equ    0FE00h    ; disk buffer (256 bytes)
  86. ;            0FF00h    ; to 0FFFFh used by 8502
  87. ;
  88. ; the following are C128 system equates
  89. ;
  90. enable$z80    equ    0FFD0h        ; 8502 code
  91. return$z80    equ    0FFDCh
  92. enable$6502    equ    0FFE0h        ; Z80 code
  93. return$6502    equ    0FFEEh
  94.  
  95.     page
  96. start    set    parm$block+1    ; 1st byte used as Intterrupt pointer
  97. space    vic$cmd,1        ;; bios8502 command byte
  98. space    vic$drv,1        ;  bios8502 drive (bit 0 set, drv 0)
  99. space    vic$trk,1        ;; bios8502 track #
  100. space    vic$sect,1        ;; bios8502 sector #
  101. space    vic$count,1        ;  bios8502 sector count
  102. space    vic$data,1        ;; bios8502 data byte to/from
  103. space    cur$drv,1        ;  current disk installed to Vir. drive
  104. space    fast,1            ;  bit 0 set, drv 0 is fast. ect. 
  105.  
  106. space    key$tbl,2        ;; pointer to keyboard table
  107. space    fun$tbl,2        ;; pointer to function tableèspace    color$tbl$ptr,2        ;; pointer to logical color table
  108. space    fun$offset,1        ;; function # to be preformed
  109. space    sound$1,2        ;;
  110. space    sound$2,2        ;;
  111. space    sound$3,2        ;;
  112.  
  113. space    @trk,2            ;; current track number
  114. space    @dma,2            ;; current DMA address
  115. ;
  116. ; below here not used by ROM
  117. ;
  118. space    @sect,2            ; current sector number
  119. space    @cnt,1            ; record count for multisector transfer
  120. space    @cbnk,1            ; bank for processor operations
  121. space    @dbnk,1            ; bank for DMA operations
  122. space    @adrv,1            ; currently selected disk drive
  123. space    @rdrv,1            ; controller relative disk drive
  124. space    sys$speed,0    ; byte value 0=1MHz, 1=2 MHz (no 40 column disp)
  125. space    ccp$count,1        ; number of records in the CCP (not used)
  126. space    stat$enable,1        ; status line enable
  127.                 ;  7 kybrd, key codes(1), functions(0)
  128.                 ;  6 40 column tracking on(0), off(1)
  129.                 ;  0 disk stat, enable(1), disable(0) 
  130. space    emulation$adr,2        ; address of current emulation
  131. space    usart$adr,2        ; PTR to 6551 reg (not used before 6 Dec 85)
  132. ; CXIO equates
  133. space    int$hl,2+20        ; interrupt HL hold location
  134. space    int$stack,0        ; currently only 10*2 used
  135. space    user$hl$temp,2        ; user function HL hold location
  136. space    hl$temp,2        ; misc temp storage (used by VECTOR)
  137. space    de$temp,2        ; misc temp storage (used by VECTOR)
  138. space    a$temp,1        ; misc temp storage (used by VECTOR)
  139. space    source$bnk,1        ; inter bank move source bank #
  140. space    dest$bnk,1        ; inter bank move dest bank #
  141. space    MFM$tbl$ptr,2        ; pointer to MFM table
  142. ; 1st release end (3 June and 1 Aug 85)
  143. space    prt$conv$1,2        ; pointer to printer 1 ASCII Conversion
  144. space    prt$conv$2,2        ; pointer to printer 2 ASCII Conversion
  145. space    key$FX$function,2
  146. space    XxD$config,1        ; bit 7    0 = no parity    1 = parity
  147.                 ; bit 6    0 = mark/space    1 = odd/even
  148.                 ; bit 5    0 = space/even    1 = mark/odd
  149.                 ; bit 1    0 = 1 stop bit    1 = 2 stop bits
  150.                 ; bit 0    0 = 7 data bits    1 = 8 data bits
  151.  
  152. space    RS232$status,1        ; bit 7, 1=send data, 0=no data
  153.                 ; bit 6, 1=sending data
  154.                 ; bit 5, 1=recv que active
  155.                 ; bit 4, 1=parity error
  156.                 ; bit 3, 1=framing error
  157.                 ; bit 2, 1=recv over run (no used)
  158.                 ; bit 1, 1=receiving data
  159.                 ; bit 0, 1=Data byte ready
  160.  
  161. space    xmit$data,1        ; data byte to sendèspace    recv$data,1        ; received data byte
  162.  
  163. ;
  164. ; The following equates are used by the interrupt driven keyboard handler
  165. ;
  166. space    int$rate,1
  167. ;
  168. ;    1st byte is a pointer into table, 2nd to 12th byte represent
  169. ;    the keyboards current state (active low), NOTE: only
  170. ;    current if key$buffer is not full
  171. ;
  172. space    key$scan$tbl,12
  173. ;
  174. ;    keyboard roll over buffer
  175. ;
  176. key$buf$size    equ    8*2        ; must be an even number of bytes
  177. space    key$get$ptr,2
  178. space    key$put$ptr,2
  179. space    key$buffer,key$buf$size
  180. ;
  181. ;    software UART recv buffer
  182. ;
  183. RxD$buf$size    equ    64
  184. space    RxD$buf$count,1
  185. space    RxD$buf$put,1
  186. space    RxD$buf$get,1
  187. space    RxD$buffer,RxD$buf$size
  188. space    tick$vol,1
  189.  
  190. INT$vector    equ    0FDFDh        ;; contains a JMP int$handler
  191.                     ; (in common)
  192.     page
  193. ;===> 40 column misc parm
  194. start    set    BANK$parm$blk
  195. space    temp$1,2        ;;
  196. space    @off40,0        ;;
  197. space    cur$offset,2        ;;
  198. space    old$offset,1        ;;
  199. space    prt$flg,1        ;;
  200. space    flash$pos,2        ;;
  201. ;
  202. ;===> 40 column position and color storage
  203. space    paint$size,1        ;;
  204. space    char$adr$40,2        ;;
  205. space    char$col$40,1        ;;
  206. space    char$row$40,1        ;;
  207. space    attr$40,1        ;;
  208. space    bg$color$40,1        ;;
  209. space    bd$color$40,1        ;;
  210. space    rev$40,1        ;;
  211. ;
  212. ;===> 80 column position and color storage
  213. space    char$adr,2        ;;
  214. space    char$col,1        ;;
  215. space    char$row,1        ;;èspace    current$atr,1        ;;
  216. space    bg$color$80,1        ;;
  217. space    char$color$80,1        ;;
  218. ;    ROM uses localtions above this point
  219. ;
  220. ;===> Emulation parameters
  221. space    parm$base,2
  222. space    parm$area$80,3
  223.     ;    ds    2    ; 80 column exec$adr
  224.     ;    ds    1    ; 80 column row #
  225. space    parm$area$40,3
  226.     ;    ds    2    ; 40 column exec$adr
  227.     ;    ds    1    ; 40 column row #
  228. space    buffer$80$col,40*2
  229. ;
  230. ;===> CXIO parameters
  231. ;    int$count not used by releases past 10 Oct 85
  232. space    int$count,1        ; one added every 1/60th sec
  233. space    key$buf,1
  234. ;
  235. ;===> CXKEYS parameters
  236. space    key$down$tbl,11*2    ; not used any more (int code)
  237. ;;;;; free space above, new interrupt driven code does not require this space 
  238. ; control$keys    equ    key$down$tbl+11*2 ; byte, not used any more (int code)
  239.  
  240. space    commodore$mode,1
  241. space    msgptr,2
  242. space    offset,1
  243. space    cur$pos,1
  244. space    string$index,1
  245. ; 1st release end (3 June 85)
  246. space    sys$freq,1        ; -1=50Hz, 0=60Hz
  247. ; 2nd release end (1 Aug 85)
  248.  
  249.     page
  250.  
  251. ;===> temp ROM boot data storage
  252. blk$ptr$cnt    equ    32
  253. start    set    boot$parm
  254. space    load$count,2        ; number of 128 byte blocks to load
  255. space    ld$blk$ptr,2        ; current sector dma pointer
  256. space    blk$unld$ptr,2        ; read memory block (1k,2K) pointer
  257. space    block$size,1        ; block size (1K=32 or 2K=64)
  258. space    block$end,2        ; allow 48K cpm.sys to load
  259. space    block$ptrs,blk$ptr$cnt    ; end of block load buffer (+1K or +2K)
  260. space    info$buffer,12
  261.                     ; CPM3.sys load adr's and counts
  262. space    ext$num,1        ; CPM3.SYS current ext #
  263. space    retry,1+64
  264. space    boot$stack,0        ; allow 64 bytes of stack
  265.  
  266. ;===> special equates used by CXKEY
  267. special        equ    00010111b
  268. SF$exit        equ    001h        ; RETURN KEY
  269. SF$insert    equ    028h        ; PLUS KEYèSF$delete    equ    02Bh        ; MINUS KEY
  270. alpha$toggle    equ    03Dh        ; commodore key
  271. alt$key        equ    050h        ; alterant key
  272. SF$left        equ    055h        ; left arrow key
  273. lf$arrow    equ    055h        ; left arrow key
  274. SF$right    equ    056h        ; right arrow key
  275. rt$arrow    equ    056h        ; right arrow key
  276.  
  277.  
  278. buff$large    equ    25
  279. buff$small    equ    7
  280. buff$pos    equ    7
  281.  
  282.  
  283.     page
  284. ;===> External RS232 interface controls
  285. ; rxd$6551    equ    0        ; read
  286. ; txd$6551    equ    0        ; write
  287. ; status$6551    equ    1        ; read
  288. ; reset$6551    equ    1        ; write
  289. ; command$6551    equ    2        ; read/write
  290. ; control$6551    equ    3        ; read/write
  291.  
  292. txrdy        equ    10h
  293. rxrdy        equ    08h
  294. cmd$init    equ    0bh    ; no parity, enable txd + rxd, interrupts off
  295. cntr$init$19200    equ    1Fh    ; 1 stop, 8 bits, 19200 baud 
  296. cntr$init$9600    equ    1Eh    ; 1 stop, 8 bits, 9600 baud (internal)
  297. cntr$init$600    equ    17h    ; 600 baud
  298.  
  299. ;===> memory management loactions
  300. mmu$start    equ    MMU
  301. conf$reg    equ    MMU        ; 3eh
  302. conf$reg$1     equ    MMU+1        ; 3fh
  303. conf$reg$2    equ    MMU+2        ; 7fh
  304. conf$reg$3    equ    MMU+3        ; 3eh
  305. conf$reg$4    equ    MMU+4        ; 7eh
  306. mode$reg    equ    MMU+5        ; b1h
  307. ram$reg        equ    MMU+6        ; 0bh 16K top Common
  308. page$0$l    equ    MMU+7        ; 00h
  309. page$0$h    equ    MMU+8        ; 01h
  310. page$1$l    equ    MMU+9        ; 01h    
  311. page$1$h    equ    MMU+10        ; 01h
  312. mmu$version    equ    MMU+11        ; ??h
  313.  
  314. enable$C64    equ    11110001b    ; FS=0
  315. z80$off        equ    10110001b    ; value to be write to enable 8502
  316. z80$on        equ    10110000b
  317. fast$rd$en    equ    Z80$on+0    ; fast serial read
  318. fast$wr$en    equ    Z80$on+8    ; fast serial write
  319. common$4K    equ    09h        ; top  4K common
  320. common$8K    equ    0ah        ; top  8K common
  321. common$16K    equ    0bh        ; top 16K common
  322.  
  323. ;===> preconfiguration mapsèforce$map    equ    0ff00h
  324. bank$0        equ    0ff01h        ; 3fh
  325. bank$1        equ    0ff02h        ; 7fh
  326. io        equ    0ff03h        ; 3eh
  327. io$0        equ    0ff03h        ; 3eh
  328. io$1        equ    0ff04h        ; 7eh
  329.  
  330.     page
  331. ;===> 80 column display equates
  332. DS$index$reg    equ    DS8563
  333. DS$status$reg    equ    DS8563
  334. DS$data$reg    equ    DS8563+1
  335. ;===> register pointers
  336. DS$cursor$high    equ    14
  337. DS$cursor$low    equ    15
  338. DS$rw$ptr$high    equ    18
  339. DS$rw$ptr$low    equ    19
  340. DS$rw$data    equ    31
  341. DS$color    equ    26
  342. ;===> status bits
  343. DS$ready    equ    80h
  344. DS$lt$pen    equ    40h
  345. ;===> display memory layout  (16K) 0-3fffh 
  346. DS$screen    equ    0000h
  347. DS$attribute    equ    0800h
  348. DS$char$def    equ    2000h
  349. ;
  350. ;===> VIC equates  (8564)
  351. ;
  352. VIC$blk        equ    VIC+17        ; bit 4 = 1 for screen on
  353. VIC$blk$msk    equ    00010000b    ;
  354.  
  355. VIC$key$row    equ    VIC+47        ; output
  356.  
  357. VIC$speed    equ    VIC+48        ; bit 0 = 1 for fast
  358. VIC$speed$msk    equ    00000001b    ;
  359.  
  360. ; vic colors
  361. black        equ    0
  362. white        equ    1
  363. red        equ    2
  364. cyan        equ    3
  365. purple        equ    4
  366. green        equ    5
  367. blue        equ    6
  368. yellow        equ    7
  369. orange        equ    8
  370. brown        equ    9
  371. lt$red        equ    10
  372. dark$grey    equ    11
  373. med$gray    equ    12
  374. lt$green    equ    13
  375. lt$blue        equ    14
  376. lt$grey        equ    15
  377. è    page
  378.  
  379. RM$status    equ    RAM$dsk$base    ;read only register
  380. ;   bit 7    Interrupt pending if 1
  381. ;    6    Transfer complete if 1
  382. ;    5    Block verify error if 1
  383. ;   note:  bits 5-7 are cleared when read
  384. ;    4    128K if 0,  512K if 1
  385. ;    3-0    Version #
  386. ;
  387. RM$command    equ    RAM$dsk$base+1    ;r/w
  388. ;   bit    7    execute per current config. if set
  389. ;    6    reserved
  390. ;    5    enable auto reload if set (restores all register to
  391. ;            value before command was done, else point to
  392. ;            next byte to read/write.)
  393. ;    4    disable FF00 decode if set (do operation after command writen)
  394. ;    3,2    reserved
  395. ;    1,0    00 = transfer C128 --> Ram Disk
  396. ;        01 = Transfer C128 <-- Ram Disk
  397. ;        10 = swap     C128 <-> Ram Disk
  398. ;        11 = Verify   C128  =  Ram Disk
  399. ;
  400. RM$128$low    equ    RAM$dsk$base+2    ;r/w
  401. ;    bits 0 to 7 of C128 address
  402. ;
  403. RM$128$mid    equ    RAM$dsk$base+3    ;r/w
  404. ;    bits 8 to 15 of the C128 address
  405. ;
  406. RM$ext$low    equ    RAM$dsk$base+4    ;r/w
  407. ;    bits 0 to 7 of Ram Disk address
  408. ;
  409. RM$ext$mid    equ    RAM$dsk$base+5    ;r/w
  410. ;    bits 8 to 15 of Ram Disk address
  411. ;
  412. RM$ext$hi    equ    RAM$dsk$base+6    ;r/w
  413. ;    bit  16       of Ram Disk address if 128K version
  414. ;    bits 16 to 18 of Ram Disk address if 512K version
  415. ;
  416. RM$count$low    equ    RAM$dsk$base+7    ;r/w
  417. ;    low byte transfer count (bits 0-7)
  418. ;
  419. RM$count$hi    equ    RAM$dsk$base+8    ;r/w
  420. ;    hi byte transfer count  (bits 8-15)
  421. ;
  422. RM$intr$mask    equ    RAM$dsk$base+9    ;r/w
  423. ;   bit    7    1=enable chip interrupts
  424. ;    6    1=enable end of block interrupts
  425. ;    5    1=enable verify error interrupts
  426. ;
  427. RM$control    equ    RAM$dsk$base+10    ;r/w
  428. ;   bit    7,6        00    Increment both addresses  (default)
  429. ;        01    Fix expansion address
  430. ;        10    Fix C128 address
  431. ;        11    Fix both addressesè;
  432.  
  433.     page
  434. ;===> CIA equates
  435.  
  436. Data$a        equ    00h
  437. Data$b        equ    01h
  438. Data$dir$a    equ    02h
  439. Data$dir$b    equ    03h
  440. timer$a$low    equ    04h
  441. timer$a$high    equ    05h
  442. timer$b$low    equ    06h
  443. timer$b$high    equ    07h
  444. tod$sec$60    equ    08h
  445. tod$sec        equ    09h
  446. tod$min        equ    0ah
  447. tod$hrs        equ    0bh
  448. sync$data    equ    0ch
  449. int$ctrl    equ    0dh
  450. cia$ctrl$a    equ    0eh
  451. cia$ctrl$b    equ    0fh
  452. CIA$hours    equ    CIA1+tod$hrs
  453.  
  454. key$row        equ    CIA1+Data$a    ; output
  455. key$col        equ    CIA1+Data$b    ; input
  456.  
  457.  
  458. data$hi        equ    4        ; RS232 data line HI
  459. data$low    equ    0        ; RS232 data line LOW
  460.  
  461. lf$shift$key    equ    80h
  462. rt$shift$key    equ    10h
  463. commodore$key    equ    20h
  464. control$key    equ    04h
  465.  
  466. type$lower    equ    0
  467. type$upper    equ    1
  468. type$shift    equ    2
  469. type$cntrl    equ    3
  470. type$field    equ    00000011b
  471.     
  472.     page
  473.  
  474. bnk1    equ    1
  475. page0    equ    0
  476. page1    equ    1
  477.  
  478. MMU$tbl$M    macro
  479.     db    3fh,3fh,7fh,3eh,7eh        ; config reg's
  480.     db    z80$on,common$8K        ; mode & mem
  481.     db    page0,bnk1,page1,bnk1        ; page reg's 
  482.     endm
  483.  
  484.     page
  485. ;è;    ROM functions
  486. ;
  487. TJMP    macro    x
  488.     rst 2 ! db x
  489.     endm
  490.  
  491. TCALL    macro    x
  492.     mvi l,x ! rst 4
  493.     endm
  494.  
  495. RJMP    macro    x
  496.     rst 3 ! db x
  497.     endm
  498.  
  499. RCALL    macro    x
  500.     mvi l,x ! rst 5
  501.     endm
  502.  
  503. FR$40            equ    2    ; offset to 40 column ROM functions
  504.  
  505. FR$wr$char        equ    00h    ; D=char auto advance
  506. FR$cursor$pos        equ    04h    ; B=row, C=column
  507. FR$cursor$up        equ    08h
  508. FR$cursor$down        equ    0Ch
  509. FR$cursor$left        equ    10h
  510. FR$cursor$rt        equ    14h
  511. FR$do$cr        equ    18h
  512. FR$CEL            equ    1Ch
  513. FR$CES            equ    20h
  514. FR$char$ins        equ    24h
  515. FR$char$del        equ    28h
  516. FR$line$ins        equ    2Ch
  517. FR$line$del        equ    30h
  518. FR$color        equ    34h    ; B=color
  519. FR$attr            equ    38h    ; B=bit to set/clear, C=bit value
  520. FR$rd$chr$atr        equ    3Ch    ; in  D=row, E=col
  521.                     ; out H=row, L=col, B=char, C=attr(real)
  522. FR$wr$chr$atr        equ    40h    ; in  D=row, E=col, B=char, C=attr(real)
  523.                     ; out H=row, L=col
  524. FR$rd$color        equ    44h
  525. ;FR$wr$color        equ    48h
  526. ;            equ    4Ch
  527.  
  528.     page
  529. ;
  530. FR$trk$sect        equ    50h
  531. FR$check$CBM        equ    52h
  532. FR$bell            equ    54h
  533. ;            equ    56h
  534. ;            equ    58h
  535. ;            equ    5Ah
  536. ;            equ    5Ch
  537. ;            equ    5Eh
  538.  
  539. FR$trk$40        equ    60hèFR$set$cur$40        equ    62h
  540. FR$line$paint        equ    64h
  541. FR$screen$paint        equ    66h
  542. FR$prt$msg$both        equ    68h
  543. FR$prt$de$both        equ    6Ah
  544. FR$update$it        equ    6Ch
  545. ;            equ    6Eh
  546.  
  547. FR$ASCII$to$pet        equ    70h
  548. FR$cur$adr$40        equ    72h
  549. FR$cur$adr$80        equ    74h
  550. FR$look$color        equ    76h
  551. ;            equ    78h
  552. FR$blk$fill        equ    7Ah    ; HL passed on the stack
  553. FR$blk$move        equ    7Ch    ; "
  554. FR$char$inst        equ    7Eh    ; "
  555.  
  556. ;
  557. ;    fixed ROM locations
  558. ;
  559. R$cmp$hl$de        equ    100h-6
  560. R$write$memory        equ    180h+0
  561. R$read$memory        equ    180h+3
  562. R$set$update$adr    equ    180h+6
  563. R$wait            equ    180h+9
  564.  
  565. R$status$color$tbl    equ    1000h-246-16
  566. R$color$convert$tbl    equ    1000h-230-16
  567.  
  568.     page
  569. ;
  570. ;    Disk type byte definition
  571. ;
  572. ;    bit    7    0=GCR,  1=MFM
  573. ;
  574. ;        if bit 7 is 1 (MFM)
  575. ;        6    C0=0,    C1=1    (side 2 #, 0 to (n/2)-1 or n/2 to n-1)
  576. ;        5,4    00=128, 01=256, 10=512, 11=1024  byte/sector
  577. ;        3,2,1    disk type (MFM)
  578. ;        0    starting sector # ( 0 or 1)
  579. ;
  580. ;        if bit 7 is 0 (GCR)
  581. ;        6    unused (set to 0)
  582. ;        5,4    01  (256 byte sectors) (for 1541or 1571)
  583. ;            10  (512 byte sectors) (for 1581)
  584. ;        3,2,1    disk type (GCR)
  585. ;            Type0 = none,  set track and sector as passed
  586. ;            Type1 = C64 CP/M   type disk (1541-71)
  587. ;            Type2 = C128 CP/M  type disk (1541-71) 
  588. ;        0    unused (set to 0)
  589.  
  590. MFM    equ    1*128
  591. C0    equ    0*64        ; 2nd side start at begining
  592. C1    equ    1*64        ; 2nd side continues from first
  593. C1$bit    equ    6è
  594. Type0    equ    0*2        ; (MFM)    top, bottom then next track
  595.                 ;     (TRK# 0 to (34 or 39))
  596. Type1    equ    1*2        ; (MFM)    top (trk 0 even), bottom (trk 1 odd)
  597.                 ;     (TRK# 0 to (69 or 79))
  598. Type2    equ    2*2        ; (MFM)    top TRK# 0 to 39, bottom TRK# 40 to 79 
  599.                 ;     (TRK# on back start at 39 and go to 0)
  600. Type7    equ    7*2        ; (MFM) pass the byte values supplied in @trk
  601.                 ;    and @sect
  602.  
  603. TypeX    equ    7*2
  604.  
  605. S0    equ    0*1        ; start at sector 0
  606. S1    equ    1*1        ; start at sector 1
  607.  
  608. S128    equ    0*16
  609. S256    equ    1*16
  610. S512    equ    2*16
  611. S1024    equ    3*16
  612.  
  613. ;
  614. dsk$none    equ    Type0+S256    ; access to any sector on the disk
  615. dsk$c64        equ    Type1+S256
  616. dsk$c128    equ    Type2+S256
  617. dsk$1581    equ    Type2+S512
  618.  
  619. dir$track    equ    18        ; C64   disk dir track
  620. c1581$dir$trk    equ    39        ; C1581 disk dir track
  621.  
  622.     page
  623. ;
  624. ;    6510 commands
  625. ;
  626. vic$reset    equ    -1    ; reboot C128
  627. vic$init    equ    0    ; initilize the bios8502
  628. vic$rd        equ    1    ; read one sector of data (256 bytes) 
  629. vic$wr        equ    2    ; write one sector of data
  630. vic$rdF        equ    3    ; set-up for fast read (many sectors)
  631. vic$wrF        equ    4    ; set-up for fast write
  632. vic$test    equ    5    ; test current disk in drive
  633. vic$query    equ    6    ; get start sectors and #sector/trk
  634. vic$prt        equ    7    ; print data character
  635. vic$frmt    equ    8    ; format a disk (1541)
  636. vic$user$fun    equ    9
  637. vic$RM$rd    equ    10    ; RAM disk read
  638. vic$RM$wr    equ    11    ; RAM disk write
  639.  
  640. ;
  641. ;    control charactors
  642. ;
  643. eom        equ    00h
  644. bell        equ    07h
  645. bs        equ    08h
  646. lf        equ    0ah
  647. cr        equ    0dhèxon        equ    11h
  648. xoff        equ    13h
  649. esc        equ    1bh
  650.  
  651.